package com.dtw.ditouwang.beans;

import android.os.Parcel;
import android.os.Parcelable;

import com.amap.api.maps.model.LatLng;

import java.util.List;

public class MovementBackBean {

    /**
     * flag : Success
     * msg : 查询成功!
     * result : true
     * data : {"id":35,"times":"2018-12-22","room_type":"室内","room_type_id":"1","type":"健走","licheng":"0.01475","weather":"多云","speed_distribution":"1423.7288","gold":"0.3449","tili":"0","times_count":"00:00:21","trajectory":"","head":"/public/uploads/20181211\\44a15ef4bd06378bd9749f3fdc3d1eea.jpg","nickname":"","medal":[]}
     */

    private String flag;
    private String msg;
    private boolean result;
    private DataBean data;

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean implements Parcelable{
        /**
         * id : 35
         * times : 2018-12-22
         * room_type : 室内
         * room_type_id : 1
         * type : 健走
         * licheng : 0.01475
         * weather : 多云
         * speed_distribution : 1423.7288
         * gold : 0.3449
         * tili : 0
         * times_count : 00:00:21
         * trajectory :
         * head : /public/uploads/20181211\44a15ef4bd06378bd9749f3fdc3d1eea.jpg
         * nickname :
         * medal : []
         */

        private int id;
        private String times;
        private String room_type;
        private String room_type_id;
        private String type;
        private String licheng;
        private String weather;
        private String speed_distribution;
        private String gold;
        private String tili;
        private String times_count;
        private List<LatLng> trajectory;
        private String head;
        private String nickname;
        private List<MedalBean> medal;
        private String step_frequency;
        private String step;
        private String quantity;
        private String avg_speed;
        private String stride;
        private SubsectionBean subsection;

        protected DataBean(Parcel in) {
            id = in.readInt();
            times = in.readString();
            room_type = in.readString();
            room_type_id = in.readString();
            type = in.readString();
            licheng = in.readString();
            weather = in.readString();
            speed_distribution = in.readString();
            gold = in.readString();
            tili = in.readString();
            times_count = in.readString();
            trajectory = in.createTypedArrayList(LatLng.CREATOR);
            head = in.readString();
            nickname = in.readString();
            medal = in.createTypedArrayList(MedalBean.CREATOR);
            step_frequency = in.readString();
            step = in.readString();
            quantity = in.readString();
            avg_speed = in.readString();
            stride = in.readString();
            subsection = in.readParcelable(SubsectionBean.class.getClassLoader());
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeString(times);
            dest.writeString(room_type);
            dest.writeString(room_type_id);
            dest.writeString(type);
            dest.writeString(licheng);
            dest.writeString(weather);
            dest.writeString(speed_distribution);
            dest.writeString(gold);
            dest.writeString(tili);
            dest.writeString(times_count);
            dest.writeTypedList(trajectory);
            dest.writeString(head);
            dest.writeString(nickname);
            dest.writeTypedList(medal);
            dest.writeString(step_frequency);
            dest.writeString(step);
            dest.writeString(quantity);
            dest.writeString(avg_speed);
            dest.writeString(stride);
            dest.writeParcelable(subsection, flags);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public String getStep_frequency() {
            return step_frequency;
        }

        public void setStep_frequency(String step_frequency) {
            this.step_frequency = step_frequency;
        }

        public String getStep() {
            return step;
        }

        public void setStep(String step) {
            this.step = step;
        }

        public String getQuantity() {
            return quantity;
        }

        public void setQuantity(String quantity) {
            this.quantity = quantity;
        }

        public String getAvg_speed() {
            return avg_speed;
        }

        public void setAvg_speed(String avg_speed) {
            this.avg_speed = avg_speed;
        }

        public String getStride() {
            return stride;
        }

        public void setStride(String stride) {
            this.stride = stride;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getTimes() {
            return times;
        }

        public void setTimes(String times) {
            this.times = times;
        }

        public String getRoom_type() {
            return room_type;
        }

        public void setRoom_type(String room_type) {
            this.room_type = room_type;
        }

        public String getRoom_type_id() {
            return room_type_id;
        }

        public void setRoom_type_id(String room_type_id) {
            this.room_type_id = room_type_id;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getLicheng() {
            return licheng;
        }

        public void setLicheng(String licheng) {
            this.licheng = licheng;
        }

        public String getWeather() {
            return weather;
        }

        public void setWeather(String weather) {
            this.weather = weather;
        }

        public String getSpeed_distribution() {
            return speed_distribution;
        }

        public void setSpeed_distribution(String speed_distribution) {
            this.speed_distribution = speed_distribution;
        }

        public String getGold() {
            return gold;
        }

        public void setGold(String gold) {
            this.gold = gold;
        }

        public String getTili() {
            return tili;
        }

        public void setTili(String tili) {
            this.tili = tili;
        }

        public String getTimes_count() {
            return times_count;
        }

        public void setTimes_count(String times_count) {
            this.times_count = times_count;
        }

        public List<LatLng> getTrajectory() {
            return trajectory;
        }

        public void setTrajectory(List<LatLng> trajectory) {
            this.trajectory = trajectory;
        }

        public String getHead() {
            return head;
        }

        public void setHead(String head) {
            this.head = head;
        }

        public String getNickname() {
            return nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public List<MedalBean> getMedal() {
            return medal;
        }

        public void setMedal(List<MedalBean> medal) {
            this.medal = medal;
        }

        public SubsectionBean getSubsection() {
            return subsection;
        }

        public void setSubsection(SubsectionBean subsection) {
            this.subsection = subsection;
        }

        public static class SubsectionBean implements Parcelable{
            private List<ValueBean> values;
            private int movementTime;

            public List<ValueBean> getValues() {
                return values;
            }

            public void setValues(List<ValueBean> values) {
                this.values = values;
            }

            protected SubsectionBean(Parcel in) {
                values = in.createTypedArrayList(ValueBean.CREATOR);
                movementTime = in.readInt();
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeTypedList(values);
                dest.writeInt(movementTime);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public static final Creator<SubsectionBean> CREATOR = new Creator<SubsectionBean>() {
                @Override
                public SubsectionBean createFromParcel(Parcel in) {
                    return new SubsectionBean(in);
                }

                @Override
                public SubsectionBean[] newArray(int size) {
                    return new SubsectionBean[size];
                }
            };

            public static class ValueBean implements Parcelable{
                private float value;
                public float getValue() {
                    return value;
                }

                public void setValue(float value) {
                    this.value = value;
                }

                protected ValueBean(Parcel in) {
                    value = in.readFloat();
                }

                public static final Creator<ValueBean> CREATOR = new Creator<ValueBean>() {
                    @Override
                    public ValueBean createFromParcel(Parcel in) {
                        return new ValueBean(in);
                    }

                    @Override
                    public ValueBean[] newArray(int size) {
                        return new ValueBean[size];
                    }
                };

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel parcel, int i) {
                    parcel.writeFloat(value);
                }
            }


            public int getMovementTime() {
                return movementTime;
            }

            public void setMovementTime(int movementTime) {
                this.movementTime = movementTime;
            }

        }

        public static class MedalBean implements Parcelable{

            /**
             * id : 1
             * medal_name : xxxx
             * highlight_img : xxx.jpg
             */

            private int id;
            private String medal_name;
            private String highlight_img;

            protected MedalBean(Parcel in) {
                id = in.readInt();
                medal_name = in.readString();
                highlight_img = in.readString();
            }

            public static final Creator<MedalBean> CREATOR = new Creator<MedalBean>() {
                @Override
                public MedalBean createFromParcel(Parcel in) {
                    return new MedalBean(in);
                }

                @Override
                public MedalBean[] newArray(int size) {
                    return new MedalBean[size];
                }
            };

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getMedal_name() {
                return medal_name;
            }

            public void setMedal_name(String medal_name) {
                this.medal_name = medal_name;
            }

            public String getHighlight_img() {
                return highlight_img;
            }

            public void setHighlight_img(String highlight_img) {
                this.highlight_img = highlight_img;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(id);
                parcel.writeString(medal_name);
                parcel.writeString(highlight_img);
            }
        }
    }
}
